// *********************************************************************
//  
// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
//  
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//  
// You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>
// 
// *********************************************************************

//RFC 3921 XMPP IM 2.2.2.1. Show
Strophe.addConnectionPlugin('presencia', {

  init: function (conexion) {
    this.conexion = conexion;
  },

    //chat -- The entity or resource is actively interested in chatting.
  chat: function () {
    this.conexion.send($pres({show: "chat"}));
  },

  //If no <show/> element is provided, the entity is assumed to be online and available.
  online: function () {
    this.conexion.send($pres());
  },

  //dnd -- The entity or resource is busy (dnd = "Do Not Disturb").
  dnd: function () {
    this.conexion.send($pres({show: "dnd"}));
  },

  //away -- The entity or resource is temporarily away.
  away: function () {
    this.conexion.send($pres({show: "chat"}));
  },

  //xa -- The entity or resource is away for an extended period (xa ="eXtended Away").
  extended_away: function () {
    this.conexion.send($pres({show: "xa"}));
  },

  offline: function () {
    this.conexion.send($pres({type: "unavailable"}));
  }

});
